<extend name="public@:index_basics"/>
<block name="body">
    <include file="public@:head"/>
    <!--查询框-->
    <section id="services" style="background-color: #F5F5F5;">
        <div class="ddcx">
            <include file="public@:select_input"/>
            <div class="ddcxright col-sm-8 col-xs-12">
                <div class="ts_con">
                    <form id="formId" action="{:cmf_url('complaint')}" method="post">
                        <!--<input type="hidden" name="cod_id" value="{$code_id}">-->
                         <p>
                             <span>订单编号</span>
                             <input type="text" name="orderid" value="{$code_id}" placeholder="输入您要投诉的订单编号">
                         </p>
                        <p>
                            <span>举报原因</span>
                            <select name="type" >
                                <option value="">--请选择投诉原因--</option>
                                <navigation nav-id="4" root="" id="main-navigation" class="">
                                    <option value="{$menu.name}">{$menu.name}</option>
                                </navigation>
                            </select>
                        </p>
                        <p>
                            <span>联系方式</span>
                            <input type="text" name="phone" placeholder="请填写您的联系方式，推荐QQ号（用于卖家联系）">
                        </p>
                        <p style="height:200px;">
                            <span style="height:200px; line-height:200px;">详细内容</span>
                            <textarea name="else"  placeholder="请具体说明问题，如：卡密无法正常充值，卖家不处理等，如不填写或随意填写，按照恶意投诉处理"></textarea>
                        </p>
                        <button class="btn_ts">提交投诉</button>
                    </form>

                </div>
            </div>
        </div>
    </section>
    <link rel="stylesheet" href="__STATIC__/js/loading/css/loading.css">
    <script src="__STATIC__/js/loading/js/loading.js"></script>
    <script>

        $(function () {
            $("#formId").submit(function () {
                $('body').loading({
                    title:'验证投诉中...'
                    ,discription:''
                    ,name:'ts'
                })
                $.post("{:cmf_url('complaint')}",$(this).serialize(),function (da) {
                    removeLoading('ts');
                    if(da.code == 0){
                    	if ($(window).width() > 1024) {
                        sweetAlert(da.msg,'投诉提示','error')
                       }else{
                       	alert(da.msg)
                       }
                    }else{
                        swal({
                            title:da.msg
                            ,type:'success'
                        }).then(function () {
                            location.href="/";
                        })
                    }
                })

                return false;
            })
        })
    </script>
</block>

